import java.util.Scanner;

// 求完全数

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count = 0;
        for (int i = 1; i <= n; i++) {
            if(isApproximate(i) == i)
                count++;
        }
        System.out.println(count);
    }

    private static int isApproximate(int x) {
        int sum = 0;
        for(int i = 1; i < Math.sqrt(x); ++i) {
            if(x % i == 0) {
                sum += i;
                if(i != 1) // 排除x这个数本身.
                    sum += x / i;
            }
        }
        return sum;
    }

}
